Skip to content

Pin the install-ID reset and a getBuiltinModule that fails - #45

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/pin-install-id-reset
Nov 16, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/pin-install-id-reset

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle on TraceClient.installIdFromFile. Tests only; no behavior changed.

  • "Resetting it" is now pinned. The README says that deleting the file's ID line makes the next start write a new one. Only a missing file and a file of invalid lines were tested before. The new test empties the file ("", "\n", a comment line) and checks three things: a new UUID is written, it is reused on the next call, and a value put in by hand is used as is.
  • A getBuiltinModule that fails is now pinned. Only a missing process.getBuiltinModule was tested before. The new test covers one that throws and one that returns nothing for node:fs. Each call gets a fresh ID and no file is written, which matches the TSDoc ("where that is missing, the ID is kept in memory").

No tracking issue: the gap was found during triage.

Skipped issues

Test plan

  • CI test job is green on the head SHA (npm run typecheck, npm test), with the executed-test count read from the log
  • The local anchor is UNVERIFIED: node is not installed in this session's environment, so CI on the PR head is the gate.

Cross-client and changelog

  • No cross-client-visible behavior changed. trace-client-python and trace-client-java need nothing.
  • CHANGELOG.md: no entry, because there is no user-visible change (tests only).

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

The README's "Resetting it" says deleting the file's ID line makes the next
start write a new one, but only a missing file and a file of invalid lines
were tested. The new test empties the file three ways and checks that a new
UUID is written and then reused, and that a value put in by hand is used.

installIdFromFile was tested only where getBuiltinModule is missing. The
second new test covers one that throws and one that returns nothing: a fresh
ID each call, and no file written. No behavior changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (CI-anchored):

  • Scope: PASS. git diff --stat origin/main lists one file, tests/trace-client.test.ts (+38). Both tests sit in the existing installation ID block.
  • Tests-new: PASS (not applicable). No public member was added. Two tests were added for installIdFromFile paths that had no test before.
  • Tests-fix: PASS (not applicable). This is not a bug fix: both tests characterize current behavior, and trace-client.ts is untouched.
  • Sibling structure: PASS. No file was created. The new tests follow their neighbors: the tmpdir fixture, UUID matching, and saving and restoring process.getBuiltinModule in try/finally, as in "keeps the ID in memory where the runtime has no getBuiltinModule".
  • Sibling renames: PASS (not applicable). Nothing was renamed.
  • Docs: PASS. The tests assert what the README's "Resetting it" paragraph and the file header's "where that is missing, the ID is kept in memory" already say. No doc needed a change.
  • Issue resolution: PASS (not applicable). There is no Closes. An application name a header cannot carry drops every report #36 and A malformed enabled option fails open: only the literal false opts out #37 were skipped because they need an owner decision; the reason is in the PR body.
  • CI: PASS. Run 43842821830 on head 7babb1f is green: # tests 86, # pass 86, # fail 0, # cancelled 0. Both new tests show ok. The local anchor is UNVERIFIED (no node in the session), so this run is the gate.
  • Zero-dependency / Edge gate / never-throws / no console / export surface / version agreement: PASS. trace-client.ts, tsconfig.json and package.json are unchanged. The tests import only what the file already imported.
  • Changelog: PASS (not applicable). There is no user-visible change.
  • Cross-client parity noted: PASS. The PR body says that no cross-client-visible behavior changed.

One judgment call to flag: the "\n" reset case relies on "".split(/\r?\n/) yielding a blank line that the ID regex rejects. That is current behavior, and the test asserts it from outside the function rather than relying on how the function works inside.

tests/trace-client.test.ts:1212: the getBuiltinModule stand-ins are restored in finally, so a failing assertion cannot leak a broken process.getBuiltinModule into later tests.

This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 26f1705 into main Nov 16, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feat/pin-install-id-reset branch November 16, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant